<template>
  <div class="data-grasp">
    <CountTo
      :start-val="0"
      :duration="1000"
      :end-val="pasteBoard.index"
      class="card-panel-num"
    />
    <span>
      <div>
        &nbsp;
        <!-- 同比
        <i class="el-icon-top copyColor-btn"></i>

        <span class="num">{{ pasteBoard.same_ratio }}</span
        >% -->
      </div>
      <div>
        环比
        <i
          style="font-weight: 700"
          v-if="pasteBoard.pointer"
          class="el-icon-bottom pinkColor-btn"
        ></i>
        <i
          v-else
          style="font-weight: 700"
          class="el-icon-top copyColor-btn"
        ></i>
        {{ pasteBoard.chain_ratio }}%
      </div>
    </span>
  </div>
</template>

<script>
import CountTo from "vue-count-to";
export default {
  components: {
    CountTo,
  },
  name: "dataGrasp",
  props: {
    pasteBoard: {
      type: Object,
      requirey: true,
    },
    obj: {
      type: Object,
      requirey: true,
    },
  },
};
</script>

<style lang="scss" scoped>
.data-grasp {
  width: 15%;
  min-width: 200px;
  position: absolute;
  top: 10px;
  right: 35px;
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  > span:nth-child(1) {
    position: relative;
    &::after {
      content: "本月";
      top: 0;
      left: -115px;
      width: 200px;
      font-size: 14px;
      font-weight: 400;
      position: absolute;
    }
    font-size: 30px;
    font-weight: 700;
  }
  > span {
    .num {
      display: inline-block;
      min-width: 30px;
    }
  }
}
</style>